<%@ page import="com.apexedu.framework.util.SysPropertiesUtil" %>
<%@ page import="com.apexedu.identity.IdConstants" %>
<%@ page import="com.apexedu.identity.entity.LoginUserVO" %>
<%@ page import="com.apexedu.identity.entity.TSysMenu" %>
<%@ page import="com.apexedu.identity.security.CasLoginUtil" %>
<%@ page import="com.apexedu.util.StringUtil" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Random" %>
<jsp:useBean id="showBean" scope="application" class="com.apexedu.biz.IndexPageQuery" />
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
    request.setAttribute("basePath", basePath);
    SimpleDateFormat sdf_time = new SimpleDateFormat("yyyy/MM/dd");
    String menuid = (String)request.getAttribute("id");
    String type=(String)request.getAttribute("type");
    LoginUserVO tsysUser = (LoginUserVO) session.getAttribute(IdConstants.SESSION_USER);
    String userid="";
    String username="";
    if (tsysUser!=null){
        userid=tsysUser.getUserloginid();
        username=tsysUser.getUsername();
    }
    Random rand =new Random();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>山东大学网上服务大厅</title>


    <script src="${basePath}/resources/js/shd/jquery.js"></script>
    <script src="${basePath}/resources/jquery/jquery.raty.min.js"></script>
    <script src="${basePath}/resources/js/shd/raty.js?v=100"></script>
    <link href="${basePath}/resources/css/shd/style.css" rel="stylesheet" type="text/css" />
    <link href="${basePath}/resources/css/shd/slide.css" rel="stylesheet" type="text/css" />
    <script src="${basePath}/component/layer/layer.js" type="text/javascript"></script>
    <script type="application/javascript">
        var userid='<%=userid%>';
        function addWin(menuid){
            var url='${basePath}/s/shd/consulting-'+menuid;
            if (userid==''||userid==null){
                layer.msg("请您先登录！");
                return false;
            }
            layer.open({
                type: 2,
                title: '请填写您想要咨询的问题',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['500px', '500px'],
                content: url,
                btn: ['保存','关闭'],
                yes: function(index){
                    var url="${basePath}/ajaxProblem";
                    var body=layer.getChildFrame('body', index);
                    var menuid=body.find('#menuid').val();
                    var tid=body.find('input[name="tid"]:checked').val();
                    var pproblem=body.find('#pproblem').val();
                    var pcontent=body.find('#pcontent').val();
                    if (menuid!=''&&pproblem!=''&&pcontent!=''){
                        $.get(url, {menuid: menuid,tid:tid,pproblem:pproblem,pcontent:pcontent}, function(data){
                             if (data=='ok') {
                                window.location.reload();
                                layer.close(index);
                            }else{
                                layer.msg("操作失败！");
                            }
                        });
                    }else{
                        if (menuid==null||menuid==''){
                            layer.msg("请选择您需要咨询的服务！");
                        }else if (pproblem==null||pproblem==''){
                            layer.msg("请填写您需要咨询的服务标题！");
                        }else if (pcontent==null||pcontent==''){
                            layer.msg("请填写您需要咨询的服务内容！");
                        }
                    }
                },
                no: function(index){
                    layer.close(index);
                }
            });
        }
        function add_service(menuid){
            if (userid==''||userid==null){
                layer.msg("请您先登录！");
                return false;
            }
            if (menuid==''||menuid==null){
                layer.msg("请您选择收藏的服务！");
                return false;
            }
            var url="${basePath}/s/uc/shd/se/s/"+menuid+"/dyfw";
            $.post(url,function (data) {
                if (data=='ok') {
                    layer.msg("服务已收藏到个人中心--我订阅的服务！");
                }else if(data=="unauthorized"){
                    layer.msg("您未获得服务授权！");
                }else{
                    layer.msg("服务收藏失败！");
                }
            });
        }

        function viewWin(wid){
            var url='${basePath}/s/uc/shd/questionReply-'+wid;
            if (userid==''||userid==null){
                layer.msg("请您先登录！");
                return false;
            }
            layer.open({
                type: 2,
                title: '咨询问题内容与回复',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['600px', '500px'],
                content: url,
                btn: ['关闭'],
                no: function(index){
                    layer.close(index);
                }
            });
        }
        var basePath = '${basePath}';
        function execLogout() {
            <%
            if( CasLoginUtil.isSsoEnabled() ){
              // 通知业务系统liveBos登出。
              // 这里的地址是根据项目现场业务系统地址在门户管理后台的系统参数维护里修改。参数名用“livebos.urls”
                String liveBosUrl = SysPropertiesUtil.get("livebos.urls");
                if(StringUtil.isNotBlank(liveBosUrl)){
                    String[] liveBosUrls = liveBosUrl.split(",");
                    for(String url : liveBosUrls){
                        out.println("$(\"<iframe src='"+url+"/logout.do' height='0' frameborder='0'/>\").appendTo(\"body\");");
                    }
                }
            }
            %>
            $.get("${basePath}/identity/ajaxlogin.action?act=logout", {q: (new Date()).getTime()}, function (data) {
                data = eval("(" + data + ")");
                if (data.msg == 'success') {
                    <%
                if( CasLoginUtil.isSsoEnabled() ){
                %>
                    window.location.href = '<%=CasLoginUtil.getCasServerLogoutUrl()%>?t=' + Math.round(new Date / 1000);
                    <%
                    }else{
                    %>
                    window.location.href = '<%=request.getContextPath() %>?t=' + Math.round(new Date / 1000);
                    <%
                    }
                    %>
                } else {
                    alert(data.msg);
                }
            });

        }
    </script>
</head>
<body>
<body>
<!--header开始-->
<div class="header-wide bgRed">
    <div class="fontYH " style="width: 1136px; margin: 0 auto">
        <div style="height: 56px; width: 418px; float: left; background-image: url('${basePath}/resources/images/shd/index/logol.png')">
        </div>
        <div class="topMenu">
            <ul>
                <li><a href="${basePath}">首页</a></li>
                <li><a class="home" href="${basePath}/s/shd/fwdh">服务导航</a></li>
                <%
                    if(StringUtil.isBlank(userid)){
                %>
                <li><a href="${basePath}/index_login.jsp">用户登录</a></li>
                <%
                }else{
                %>
                <li><a href="${basePath}/s/uc/shd/ph">个人中心</a></li>
                <li><a href="#" onclick="execLogout()">注销</a></li>
                <%
                    }
                %>
            </ul>
        </div>
    </div>
</div>
<!--header结束-->
<!--右侧边滚动栏内容开始-->
<aside id="rightSide" class="panel-lv2"></aside>
<!--右侧边栏滚动内容结束-->
<!--服务项title开始-->
<div class="fence-wide service">
    <div class="yard-1136 mt21">
        <div class="de-tit fontYH">
            <span class="imge"><img src="${basePath}/resources/images/shd/index/icon/<%=rand.nextInt(11)+1%>.png" /></span>
            <span class="dt-name">${menu.menuname}</span>
            <span class="eg dt-name">Service details</span>
        </div>
        <div class="de-bt fontYH" >
            <span class="button bt-yellow" onclick="add_service('${menu.menuid}')" style="display: none;">订 阅</span>
            <span class="button bt-green" onclick="var url=encodeURIComponent('${menu.menupath}');window.open('${basePath}/s/uc/yw/index?url='+url)" style="display: none;">在线办理</span>
        </div>
    </div>
</div>
<!--服务项title开始-->
<!--基本信息注意事项流程版本开始---------------------------------------------------------------------------------------------------------------------------------------------------------->
<div class="fence-wide service">
    <div class="yard-1136-bg">
        <div class="box-info shdw">
            <div class="de-title fontYH">基本信息</div>
            <div class="info-con fontYH">
                <ul>
                    <li><span>办理单位：</span>${menu.unit}</li>
                    <li><span>办理时间：</span>${menu.workingtime}</li>
                    <li><span>办理地点：</span>${menu.workingplace}</li>
                    <li><span>联系方式：</span>${menu.contact}</li>
                    <li><span>满&nbsp;意&nbsp;度&nbsp;：</span><span class="star" data-score="${menu.score}" data-readOnly="true" style="height: 16px;line-height: 16px;text-align: center"></span></li>
                </ul>
                <div class="de-bt fontYH" >
                    <c:if test="${menu.menupath!=null&&menu.menupath.length()>0}">
                        <span class="button bt-yellow" onclick="add_service('${menu.menuid}')" title="添加到个人中心">订 阅</span>
                        <span class="button bt-green" onclick="var url=encodeURIComponent('${menu.menupath}');window.open('${basePath}/s/uc/yw/index?url='+url)">在线办理</span>
                    </c:if>
                    <c:if test="${menu.menupath==null||menu.menupath.length()<1}">
                        <span class="button bt-brown">未开通在线办理</span>
                    </c:if>
                </div>
            </div>
        </div>
        <div id="lib_Tabde" class="box-table shdw">
            <div id="lib_Menude">
                <ul>
                    <li id="d1" onclick="setTab('d',1,4)" class="hover student"><a>补充说明</a></li>
                    <li id="d2" onclick="setTab('d',2,4)" class="student"><a>注意事项</a></li>
                    <li id="d3" onclick="setTab('d',3,4)" class="teacher"><a>服务评价</a></li>
                    <li id="d4" onclick="setTab('d',4,4)" class="student"><a>常见问题</a></li>
                </ul>
            </div>

            <div class="lib_Contentde" style="height: 245px;">
                <!--规则说明开始-->
                <div id="con_d_1" style="height:265px;overflow-x:hidden">
                    <div class="pp fontYH">
                        <c:choose>
                            <c:when test="${regus !=null && fn:length(regus)!=0}">
                                <c:forEach items="${regus}" var="entity">
                                    <div style="padding:5px;text-align: left;">
                                        <div style="font-size: 20px;text-align: center;">
                                            <span>${entity.bt}</span>
                                        </div>
                                        <div style="margin-top: 10px;">
                                            <span class="service_detail_ruletitle">原始需求：</span>
                                            <span class="service_detail_ruletext">${entity.ysxqfjsm}</span>
                                            <a href="${basePath }${entity.ysxqfjurl}">点击下载</a>
                                        </div>
                                        <div style="margin-top: 10px;">
                                            <span class="service_detail_ruletitle">规章制度：</span>
                                            <span class="service_detail_ruletext">${entity.gzzdfjsm}</span>
                                            <a href="${basePath}${entity.gzzdfjurl}">点击下载</a>
                                        </div>
                                        <div style="margin-top: 10px;">
                                            <span class="service_detail_ruletitle">涉及岗位：</span>
                                            <span class="service_detail_ruletext">${entity.sjgw}</span>
                                        </div>
                                    </div>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                暂无规则说明，请联系网站管理员添加。
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>
                <!--规则说明结束-->
                <!--注意事项开始-->
                <div id="con_d_2" style="height:265px;overflow-x:hidden">
                    <div class="pp fontYH">
                        <p style="text-indent:0;">${menu.attention}</p>
                    </div>
                </div>
                <!--注意事项结束-->
                <!--流程版本开始-->
                <div id="con_d_3" style="height:265px;display: none;overflow-x:hidden">
                    <div class="pp fontYH">
                        <p>满&nbsp;意&nbsp;度&nbsp;：
                            <span class="star"   data-score="3" style="height: 16px;line-height: 16px;text-align: center"></span>
                            <span id="hint" class="hint" style="margin-right: 10px;"></span>
                        </p>
                        <input type="hidden" name="pj_score" id="pj_score">
                        <p><textarea rows="5" cols="60" placeholder="请输入评价信息" id="pjxx"></textarea></p>
                        <p style="line-height: 30px;height: 30px;margin-top: 10px;" id="pj">
                            <button hidefocus="true" type="button" onclick="evaluation('<%=userid%>','${menu.menuid}')" style="text-align: center">提交评价</button>
                        </p>
                    </div>
                </div>
                <!--注意事项结束-->
                <!--常见问题开始-->
                <div id="con_d_4" style="height:265px;display: none;overflow-x:hidden">
                    <div class="problems-con fontYH">
                        <ol>
                            <c:forEach items="${pros}" var="p" varStatus="st">
                                <li onclick="viewWin('${p.wid}')" style="text-align: left;"><a href="#">${st.count},${p.pproblem}</a><em>${p.ptime}</em> </li>
                            </c:forEach>
                        </ol>
                        <span class="button bt-blue" onclick="addWin('${menu.menuid}')" style="float: right;right: 15px;">我要提问</span>
                    </div>
                </div>
                <!--常见问题结束-->
            </div>
        </div>
    </div>
</div>
<!--tab切换开始-->
<script type="text/javascript">
    function setTab(name, cursel, n) {
        for (i = 1; i <= n; i++) {
            var menu = document.getElementById(name + i);
            var con = document.getElementById("con_" + name + "_" + i);
            menu.className = i == cursel ? "hover" : "";
            con.style.display = i == cursel ? "block" : "none";
        }
    }
</script>
<!--tab切换结束-->
<!--基本信息注意事项流程版本结束--------------------------------------------------------------------------------------------------------------------------------------------------------------------->

<!--流程说明开始-->
<div class="fence-wide service">
    <div class="yard-1136 ">
        <div class="de-title fontYH">服务详情</div>
        <div class="procs-con fontYH">${menu.rulesintroduced}</div>
    </div>
</div>
<!--流程说明结束-->

<%--<!--规则说明开始-->--%>
<%--<div class="fence-wide service">--%>
    <%--<div class="yard-1136 ">--%>
        <%--<div class="de-title fontYH">规则说明</div>--%>
        <%--<div class="procs-con fontYH">--%>
            <%--<c:choose>--%>
                <%--<c:when test="${regus !=null && fn:length(regus)!=0}">--%>
                    <%--<c:forEach items="${regus}" var="entity">--%>
                        <%--<div style="padding:10px;">--%>
                            <%--<div>--%>
                                <%--<span class="service_detail_ruletitle">业务规则：</span>--%>
                                <%--<span class="service_detail_ruletext">${entity.bt}</span>--%>
                            <%--</div>--%>
                            <%--<div style="margin-top: 10px;">--%>
                                <%--<span class="service_detail_ruletitle">原始需求：</span>--%>
                                <%--<span class="service_detail_ruletext">${entity.ysxqfjsm}</span>--%>
                                <%--<a href="${aucUrl}${entity.ysxqfjurl}">点击下载</a>--%>
                            <%--</div>--%>
                            <%--<div style="margin-top: 10px;">--%>
                                <%--<span class="service_detail_ruletitle">规章制度：</span>--%>
                                <%--<span class="service_detail_ruletext">${entity.gzzdfjsm}</span>--%>
                                <%--<a href="${aucUrl}${entity.gzzdfjurl}">点击下载</a>--%>
                            <%--</div>--%>
                            <%--<div style="margin-top: 10px;">--%>
                                <%--<span class="service_detail_ruletitle">涉及岗位：</span>--%>
                                <%--<span class="service_detail_ruletext">${entity.sjgw}</span>--%>
                            <%--</div>--%>
                            <%--<div style="margin-top: 10px;">--%>
                                <%--<span class="service_detail_ruletitle">规则描述：</span>--%>
                                <%--<span class="service_detail_ruletext">${entity.gzms}</span>--%>
                            <%--</div>--%>
                            <%--<div style="margin-top: 10px;">--%>
                                <%--<span class="service_detail_ruletitle">规则配置：</span>--%>
										<%--<span class="service_detail_ruletext">--%>
											<%--<a href="${aucUrl}${entity.fjdz}">点击下载</a>--%>
										<%--</span>--%>
                            <%--</div>--%>
                        <%--</div>--%>
                    <%--</c:forEach>--%>
                <%--</c:when>--%>
                <%--<c:otherwise>--%>
                    <%--暂无规则说明，请联系网站管理员添加。--%>
                <%--</c:otherwise>--%>
            <%--</c:choose>--%>
        <%--</div>--%>
    <%--</div>--%>
<%--</div>--%>
<%--<!--规则说明结束-->--%>


<%--<!--常见问题更多服务开始-->--%>
<%--<div class="fence-wide service" style="padding-bottom: 12px">--%>
    <%--<div class=" yard-1136-2">--%>
        <%--<div class="yard-650 " >--%>
            <%--<div class="de-title fontYH">--%>
                <%--常见问题--%>
                <%--<span class="button bt-blue ml400" onclick="addWin('${menu.menuid}')">我要提问</span>--%>
            <%--</div>--%>
            <%--<div class="problems-con fontYH " style="height: 258px;">--%>
                <%--<ol>--%>
                    <%--<c:forEach items="${pros}" var="p" varStatus="st">--%>
                        <%--<li onclick="viewWin('${p.wid}')"><a href="#">${st.count},${p.pproblem}</a><em>${p.ptime}</em> </li>--%>
                    <%--</c:forEach>--%>
                <%--</ol>--%>
            <%--</div>--%>
        <%--</div>--%>
        <%--<div class="yard-470 bgwhite">--%>
            <%--<div class="de-title fontYH">更多服务</div>--%>
            <%--<div class="more-con">--%>
                <%--<ul>--%>
                    <%--<%--%>
                    <%--List<TSysMenu> tsysmenuList = showBean.getAllMenubycondition(menuid,"8");--%>
                    <%--if(tsysmenuList.size()>0){--%>
                       <%--for (int tsysmenuList_num=0;tsysmenuList_num<tsysmenuList.size();tsysmenuList_num++){--%>
                           <%--TSysMenu tsysmenu =tsysmenuList.get(tsysmenuList_num);--%>
                    <%--%>--%>
                    <%--<li >--%>
                        <%--<div class="image tc" onclick="window.open('${basePath}/s/shd/fwdh/details/<%=tsysmenu.getMenuid()%>');">--%>
                            <%--<img src="${basePath}/resources/images/shd/index/icon/<%=rand.nextInt(11)+1%>.png">--%>
                        <%--</div>--%>
                        <%--<div class="information" onclick="window.open('${basePath}/s/shd/fwdh/details/<%=tsysmenu.getMenuid()%>');">--%>
                            <%--<div class="title fontYH tc" title="<%=tsysmenu.getMenuname()%>" style="width: 65px;"><%=tsysmenu.getMenuname()%></div>--%>
                        <%--</div>--%>
                    <%--</li>--%>
                    <%--<%}--%>
                    <%--}--%>
                    <%--%>--%>
                <%--</ul>--%>
                <%--<div style="clear:both"></div>--%>
            <%--</div>--%>
        <%--</div>--%>
    <%--</div>--%>
<%--</div>--%>
<%--<!--流程说明开始-->--%>
<div class="fence-wide service" style="padding-bottom: 12px">
    <div class="yard-1136 ">
        <div class="de-title fontYH">更多服务</div>
        <div class="more-con">
            <ul>
                <%
                    List<TSysMenu> tsysmenuList = showBean.getAllMenubycondition(menuid,"12",userid);
                    if(tsysmenuList.size()>0){
                        for (int tsysmenuList_num=0;tsysmenuList_num<tsysmenuList.size();tsysmenuList_num++){
                            TSysMenu tsysmenu =tsysmenuList.get(tsysmenuList_num);
                %>
                <li >
                    <div class="image tc" onclick="window.open('${basePath}/s/shd/fwdh/details/<%=tsysmenu.getMenuid()%>');">
                        <img src="${basePath}/resources/images/shd/index/icon/<%=rand.nextInt(11)+1%>.png">
                    </div>
                    <div class="information" onclick="window.open('${basePath}/s/shd/fwdh/details/<%=tsysmenu.getMenuid()%>');">
                        <div class="title fontYH tc" title="<%=tsysmenu.getMenuname()%>" style="width: 65px;"><%=tsysmenu.getMenuname()%></div>
                    </div>
                </li>
                <%}
                }
                %>
            </ul>
            <div style="clear:both"></div>
        </div>
    </div>
</div>
<!--常见问题更多服务结束-------------------->
<!--快捷通道开始-->
<div class="service">
    <div class="channel ">
        <div class="channel-q">
            <ul>
                <li><a href="http://portal.sdu.edu.cn/" target="_black"><img src="${basePath}/resources/images/shd/index/icon/k1.png" alt="办公系统" width="92" height="92" /></a></li>
                <li><a href="http://www.oa.sdu.edu.cn/" target="_black"><img src="${basePath}/resources/images/shd/index/icon/k2.png" alt="OA系统" width="92" height="92" /></a></li>
                <li><a href="http://www.lib.sdu.edu.cn/portal/tpl/home/index" target="_black"><img src="${basePath}/resources/images/shd/index/icon/k3.png" alt="图书馆" width="92" height="92" /></a></li>
                <li><a href="http://www.culture.sdu.edu.cn/" target="_black"><img src="${basePath}/resources/images/shd/index/icon/k4.png" alt="山大文化" width="92" height="92" /></a></li>
                <li><a href="http://www.rsc.sdu.edu.cn/2010new2/zp.php" target="_black"><img src="${basePath}/resources/images/shd/index/icon/k5.png" alt="人才招聘" width="92" height="92" /></a></li>
                <li><a href="http://www.view.sdu.edu.cn/" target="_black"><img src="${basePath}/resources/images/shd/index/icon/k6.png" alt="山大新闻" width="92" height="92" /></a></li>
            </ul>
        </div>
    </div>
</div>
<!--快捷通道结束-->
<!--footer开始-->
<%@include file="./public_foot.jsp"%>
<!--footer结束-->
</body>
</html>
